import { AdColumn } from '@/components/AdVxeTable';
import { useI18n } from '@/hooks/web/useI18n';

const { t } = useI18n();

export const columns: AdColumn[] = [
  {
    title: t('entity.idTitle'),
    field: 'Id',
    width: 0,
    visible: false,
    formVisible: true,
    formEditable: false,
    filterable: true,
    dataType: 'integer',
  },
  {
    title: t('routes.system.loginlog.ipTitle'),
    field: 'Ip',
    width: 150,
    formVisible: true,
    formEditable: false,
    filterable: true,
    dataType: 'string',
  },
  {
    title: t('routes.system.loginlog.userAgentTitle'),
    field: 'UserAgent',
    // width: 400,
    minWidth: 200,
    formVisible: true,
    formEditable: false,
    filterable: true,
    dataType: 'text',
  },
  {
    title: t('routes.system.loginlog.logoutTimeTitle'),
    field: 'LogoutTime',
    width: 150,
    formVisible: true,
    formEditable: false,
    filterable: true,
    dataType: 'datetime',
  },
  {
    title: t('entity.creationAudited.createdTimeTitle'),
    field: 'CreatedTime',
    width: 150,
    formVisible: true,
    formEditable: false,
    filterable: true,
    dataType: 'datetime',
  },
  {
    title: t('routes.system.loginlog.userIdTitle'),
    field: 'UserId',
    width: 150,
    formVisible: true,
    formEditable: false,
    filterable: true,
    dataType: 'integer',
  },
  {
    title: t('routes.system.loginlog.userNameTitle'),
    field: 'UserName',
    width: 100,
    formVisible: true,
    formEditable: false,
    filterable: true,
    filterIndex: 'User.UserName',
    dataType: 'string',
  },
  {
    title: t('routes.system.loginlog.nickNameTitle'),
    field: 'UserNickname',
    width: 150,
    formVisible: true,
    formEditable: false,
    filterable: true,
    filterIndex: 'User.NickName',
    dataType: 'string',
  },
];
